package com.br.aiops.listeners.ladder;

import com.br.aiops.counter.AlertLogCounter;
import com.br.aiops.counter.CounterLadderValue;

public class AlertCountLadderJudge extends AbstractLadderJudge {


    public AlertCountLadderJudge(AlertLogCounter counter) {
        super(counter);
    }

    @Override
    public void judgeLadder() {
        //达到告警次数
        if (counter.getAlertTimes().get() >= CounterLadderValue.getLadderValue(counter.counterKey()).getCurrentTimes().get()) {
            sendAlert();
            //升级次数阈值
            CounterLadderValue.upgradeTimes(counter.counterKey());
        }
    }
}
